class Student:
    def __init__(self,name,age):
        self.name = name
        self.age = age

    def __str__(self):
        # str返回的必须是字符串类型
        return f"我的名字是{self.name},我的年龄是{self.age}"

stu1 =  Student("张三",18)
print(stu1)



